home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / var / lib / dpkg / info / hal.postinst < prev    next >
Encoding:
Text File  |  2007-03-30  |  2.3 KB  |  80 lines

  1. #! /bin/sh
  2. # postinst script for hal
  3. #
  4. # see: dh_installdeb(1)
  5.  
  6. set -e
  7.  
  8. # summary of how this script can be called:
  9. #        * <postinst> `configure' <most-recently-configured-version>
  10. #        * <old-postinst> `abort-upgrade' <new version>
  11. #        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
  12. #          <new-version>
  13. #        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
  14. #          <failed-install-package> <version> `removing'
  15. #          <conflicting-package> <version>
  16. # for details, see http://www.debian.org/doc/debian-policy/ or
  17. # the debian-policy package
  18. #
  19. # quoting from the policy:
  20. #     Any necessary prompting should almost always be confined to the
  21. #     post-installation script, and should be protected with a conditional
  22. #     so that unnecessary prompting doesn't happen if a package's
  23. #     installation fails and the `postinst' is called with `abort-upgrade',
  24. #     `abort-remove' or `abort-deconfigure'.
  25.  
  26. case "$1" in
  27.   configure)
  28.     if ! getent passwd haldaemon >/dev/null; then 
  29.       adduser --disabled-password --quiet --system --no-create-home \
  30.         --gecos "Hardware abstraction layer" --group haldaemon
  31.     fi
  32.     if ! getent group powerdev > /dev/null; then
  33.        addgroup --quiet --system powerdev || true
  34.     fi
  35.  
  36.     # Add the plugdev group
  37.     if ! getent group plugdev > /dev/null; then
  38.        addgroup --quiet --system plugdev || true
  39.     fi
  40.  
  41.     adduser --quiet haldaemon floppy
  42.     adduser --quiet haldaemon cdrom
  43.     adduser --quiet haldaemon plugdev
  44.     adduser --quiet haldaemon powerdev
  45.  
  46.     # be sure the run dir is owned by the hal user
  47.     chown haldaemon:haldaemon /var/run/hal 2>/dev/null || true
  48.  
  49.     if [ -f /etc/init.d/hal ]; then
  50.       # handle upgrades
  51.       mv /etc/init.d/hal /etc/dbus-1/event.d/
  52.       update-rc.d hal remove
  53.     fi
  54.  
  55.     if [ -x /etc/init.d/dbus ]; then
  56.       invoke-rc.d dbus force-reload || true
  57.       /etc/dbus-1/event.d/20hal start || true
  58.     fi
  59.  
  60.     # finish the udev rules rename on upgrades
  61.     if dpkg --compare-versions "$2" le-nl "0.5.8.1-3ubuntu7"; then
  62.         rm -f /etc/udev/rules.d/85-hal.rules.moved-by-preinst
  63.     fi
  64.  
  65.   ;;
  66.   abort-upgrade|abort-remove|abort-deconfigure)
  67.   ;;
  68.   *)
  69.     echo "postinst called with unknown argument \`$1'" >&2
  70.     exit 1
  71.   ;;
  72. esac
  73.  
  74. # dh_installdeb will replace this with shell code automatically
  75. # generated by other debhelper scripts.
  76.  
  77.  
  78.  
  79. exit 0
  80.